import React, { Component } from 'react'

import { Link, withRouter } from 'react-router-dom'
import { Layout, Menu, Icon } from 'antd'
import './index.less'
import logo from  './logo.jpg'

const { Sider } = Layout

class LeftNav extends Component {
  
  render() {
    let path = this.props.location.pathname

    return (
      <Sider>
        <Link to="/" className="left-nav-header">
          <img src={logo} alt="这是logo图片"/>
          <h1>伯乐捞</h1>
        </Link>
        <Menu
          selectedKeys={[path]}
          mode="inline"
          theme="dark"
        >
          <Menu.Item key="/home" >
            <Link to="/home">
              <Icon type="container" />
              <span>简历池</span>
            </Link>
          </Menu.Item>
          
          <Menu.Item key="/screen">
            <Link to="/screen">
              <Icon type="filter" />
              <span>简历筛选</span>
            </Link>
          </Menu.Item>
          
        </Menu>
      </Sider>
    )
  }
}

export default withRouter(LeftNav)